<template>
	<view class="wrap">
		<scroll-view scroll-y="true" style="height: 100%;">
			<followdetails :list='newslist' @noticeDetail='noticeDetail' />
		</scroll-view>
	</view>
</template>

<script>
	import followdetails from '../../components/index/followdetails.vue'
	import uniLoadMore from '../../components/uni-load-more/uni-load-more.vue'
	export default {
		components: {
			followdetails,
			uniLoadMore
		},
		data() {
			return {
				newslist: [], //新闻列表
				isupdate: true
			}
		},
		onShow() {
			this.getList();
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList() {
				if (this.isEnd) {
					return
				}
				this.request({
					url: '/v1/notices',
					method: 'GET',
					data: {
						page: this.page,
						limit: this.limit
					}
				}).then((res) => {
					this.newslist = res.data
					console.log(res.data)
					if (res.data.length <= 0) {
						this.isEnd = true;
						this.status = 'noMore'
					} else {
						//this.page++
					}
				});
			},
			//点击进入详情
			noticeDetail(id) {
				uni.navigateTo({
					url: '../noticeDetail/noticeDetail?id=' + id
				})
			},
			
		}
	}
</script>

<style>

</style>
